# import http.client
# #首页
# conn=http.client.HTTPConnection('localhost')
# conn.request('GET','/smeoa/index.php?m=login&a=index')
# setcookie=conn.getresponse().getheader('Set-Cookie')#?????????????????????????????
# sessionid=setcookie.split(';')[0]
# #登录
# param='emp_no=admin&password=admin'
# header={'Content-type':'application/x-www-form-urlencoded','Cookie':sessionid}
# conn=http.client.HTTPConnection('localhost')
# conn.request('POST','/smeoa/index.php?m=login&a=check_login',param,header)
# #新增
# param='id=&opmode=add&admin=%E6%80%BB%E7%BB%8F%E7%90%861001%2F%E6%80%BB%E7%BB%8F%E7%90%86%7C1001%3B&write=%E6%80%BB%E7%9B%912001%2F%E6%80%BB%E7%9B%91%7C2001%3B&read=%E7%BB%8F%E7%90%863001%2F%E7%BB%8F%E7%90%86%7C3001%3B&folder_list=0&name=test03&folder_name=%E6%A0%B9%E8%8A%82%E7%82%B9&pid=0&sort=&is_del=0&remark=fasfd111111111111111111111111111111saf'
# header={'Content-type':'application/x-www-form-urlencoded','Cookie':sessionid}
# conn=http.client.HTTPConnection('localhost')
# conn.request('POST','/smeoa/index.php?m=notice_folder&a=save',param,header)
# response=conn.getresponse().read()
# print(response.decode())

# # #删除
# param='id=82&opmode=edit&admin=%E6%80%BB%E7%BB%8F%E7%90%861001%2F%E6%80%BB%E7%BB%8F%E7%90%86%7C1001%3B&write=%E6%80%BB%E7%9B%912001%2F%E6%80%BB%E7%9B%91%7C2001%3B&read=%E7%BB%8F%E7%90%863001%2F%E7%BB%8F%E7%90%86%7C3001%3B&folder_list=0&name=test01&folder_name=%E6%A0%B9%E8%8A%82%E7%82%B9&pid=0&sort=&is_del=0&remark=&ajax=a.txt'
# header={'Content-type':'application/x-www-form-urlencoded; charset=UTF-8','Cookie':sessionid}
# conn=http.client.HTTPConnection('localhost')
# conn.request('POST','/smeoa/index.php?m=notice_folder&a=del',param,header)
# response=conn.getresponse().read()
# print(response.decode())


import requests

# 首页
s = requests.Session()
s.get('http://localhost/smeoa/')
# 登录
datas = {'emp_no': 'admin', 'password': 'admin'}
r = s.post('http://localhost/smeoa/index.php?m=login&a=check_login', data=datas)
# print(r.text)


# #新增
# datas={'pid':'0','is_del':'0','name':'77777','folder_name':'根节点','opmode':'add','remark':'4444444444'}
# s.post('http://localhost/smeoa/index.php?m=notice_folder&a=save',data=datas)
# # #删除
# datas={'id':'80','opmode':'edit','admin':'%E6%80%BB%E7%BB%8F%E7%90%861001%2F%E6%80%BB%E7%BB%8F%E7%90%86%7C1001%3B','write':'%E6%80%BB%E7%9B%912001%2F%E6%80%BB%E7%9B%91%7C2001%3B','read':'%E7%BB%8F%E7%90%863001%2F%E7%BB%8F%E7%90%86%7C3001%3B','folder_list':'0','name':'test01','folder_name':'%E6%A0%B9%E8%8A%82%E7%82%B9','pid':'0','sort':'','is_del':'0','remark':'','ajax':'a.txt'}
# s.post('http://localhost/smeoa/index.php?m=notice_folder&a=del',data=datas)
